﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Text.RegularExpressions;

namespace FOBTV.Web.MainClass
{
	public class ParamHandler
	{
		/// <summary>
		/// 判断参数是否合法(可转为Int)
		/// </summary>
		/// <param name="param"></param>
		/// <returns></returns>
		public static bool IsLegalForInt(string param)
		{
			if (IsLegalForString(param))
			{
				Regex regex = new Regex("^[0-9]*[0-9][0-9]*$");
				if (regex.IsMatch(param))
				{
					return true;
				}
			}
			return false;
		}
		/// <summary>
		/// 判断参数是否合法(可转为String)
		/// </summary>
		/// <param name="param"></param>
		/// <returns></returns>
		public static bool IsLegalForString(string param)
		{
			if (!string.IsNullOrEmpty(param))
			{
				return true;
			}
			return false;
		}

	}
}